
<template>
  <div class="container">
    <h1>欢迎下载视力宝</h1>
    <img src="/eyelogo.png" class="imgs">
    <p>请点击右上角的三个点，选择‘在浏览器中打开’，然后下载应用。</p>
    <a :href="apdata.update_url" download="视力宝.apk" class="download-btn">点击下载</a>
    <div class="info">
      <p>应用版本：<span>{{apdata.version }}</span></p>
      <p>支持平台：<span>Android</span></p>
    </div>
  </div>
</template>

<script>
    import pick from 'lodash.pick'
    import { getAction,postAction } from '@/api/manage'
    import Vue from 'vue'
    export default {
        name: 'appDown',
        components: {},
        data () {
            return {
                visible: false,
                confirmLoading: false,
                formInfo: {},
                apdata:{},
                reportUrl:'',
                edt:false,
                options: {
                    toolbar: true,
                    url: 'data-source',
                },
                url: {
                    getversion: '/system/auth/getApk'
                }
            }
        },
        created () {
            this.getVersion()
        },
        methods: {
            getVersion(){
                getAction(this.url.getversion, {}, 0).then(res => {
                    this.apdata = res.result.data
                }).finally(() => {

                })
            },
            // 确定
            handleSubmit () {
                this.visible = false
            },
            // 关闭
            handleCancel () {
                this.close()
            },
            close () {
                this.visible = false
            }
        }
    }
</script>
<style>
  body {
    font-family: Arial, sans-serif;
    background-color: #f4f4f4;
    margin: 0;
    padding: 0;
  }
.imgs{
  text-align: center;
  width: 20%;
  margin: 20px 40%;
}
  .container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    background-color: #fff;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    border-radius: 5px;
  }

  h1 {
    text-align: center;
    color: #333;
  }

  p {
    color: #666;
    line-height: 1.6;
  }

  .download-btn {
    display: block;
    width: 100%;
    max-width: 200px;
    margin: 20px auto;
    padding: 10px 20px;
    background-color: #426be2; /* Green */
    border: none;
    border-radius: 5px;
    color: white;
    text-align: center;
    text-decoration: none;
    font-size: 16px;
    transition-duration: 0.4s;
    cursor: pointer;
  }

  .download-btn:hover {
    background-color: #426be2; /* Darken green */
  }

  .info {
    margin-top: 20px;
    color: #888;
    font-size: 14px;
  }
</style>


